<template>
  <div class="homeThree">
    <div class="w">
      <div class="box" v-for="item in goods" :key="item.id">
        <div class="head">
          <h3>{{ item.name }}</h3>
          <div class="childrenCate">
            <p v-for="it in item.children" :key="it.id">{{ it.name }}</p>
          </div>
          <span class="all">查看全部></span>
        </div>
        <div class="content">
          <div class="left">
            <img src="" alt="" v-lazyImg="item.picture" />
          </div>
          <ul class="right">
            <li v-for="its in item.goods" :key="its.id">
              <img src="" alt="" v-lazyImg="its.picture" />
              <p>{{ its.name }}</p>
              <p>{{ its.desc }}</p>
              <p>￥{{ its.price }}</p>
              <div class="bottom">
                <p>找相似</p>
                <p>发现更多宝贝></p>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["goods"],
};
</script>

<style lang="scss" scoped>
.homeThree {
  width: 100%;
  .w {
    .box {
      width: 100%;
      height: 100%;
      background-color: white;
      .head {
        width: 100%;
        height: 115px;
        display: flex;
        align-items: center;
        h3 {
          width: 720px;
          flex: 1;
          font-size: 32px;
          font-weight: 400;
          margin-left: 6px;
          height: 35px;
          line-height: 35px;
        }
        .childrenCate {
          width: 432px;
          height: 23px;
          display: flex;
          margin-right: 10px;
          p {
            // width: 88px;
            padding: 2px 12px;
            font-size: 16px;
            border-radius: 4px;
          }
        }
        .all {
          margin-right: 4px !important;
          color: #999 !important;
        }
        .all:hover {
          color: #27ba9b !important;
          cursor: pointer;
        }
      }
      .content {
        width: 100%;
        height: 610px;
        display: flex;
        justify-content: space-between;
        .left {
          width: 240px;
          height: 610px;
          background-color: #27ba9b;
          position: relative;
          img {
            height: 610px;
            position: absolute;
            top: 0;
            left: 0;
          }
        }
        .right {
          width: 990px;
          height: 100%;
          display: flex;
          justify-content: space-between;
          flex-wrap: wrap;
          align-content: space-between;
          li {
            width: 240px;
            height: 300px;
            padding: 10px 30px;
            position: relative;
            border: 1px solid transparent;
            overflow: hidden;
            img {
              width: 100%;
              height: 160px;
            }
            p {
              &:nth-child(2) {
                width: 100%;
                margin-top: 6px;
              }
              &:nth-child(3) {
                width: 100%;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
                margin-top: 6px;
                font-size: 16px;
                color: #666;
                height: 22px;
              }
              &:nth-child(4) {
                margin-top: 10px;
                font-size: 20px;
                color: #cf4444;
              }
            }
            .bottom {
              width: 100%;
              background-color: #27ba9b;
              position: absolute;
              bottom: 0;
              left: 0;
              opacity: 0;
              transform: translate3d(0, 100%, 0);
              p {
                &:nth-child(1) {
                  width: 120px;
                  height: 41px;
                  line-height: 41px;
                  margin: auto;
                  text-align: center;
                  border-bottom: 1px solid white;
                  font-size: 18px;
                  color: white;
                }
                &:nth-child(2) {
                  width: 120px;
                  height: 30px;
                  line-height: 30px;
                  margin: auto;
                  text-align: center;
                  color: white;
                }
              }
            }
          }
          li:hover {
            border: 1px solid #27ba9b;
            .bottom {
              height: 86px;
              transition: all 0.5s linear;
              transform: translate3d(0, 0, 0);
              opacity: 1;
            }
          }
        }
      }
    }
  }
}
</style>
